import { getDicts as getDicts } from '@/api/system/dict/data'

async function getTaskType() {
  const arr = []
  const res = await getDicts('data_base_type')
  res.data.forEach(f => {
    arr.push({
      value: f.dictValue,
      label: f.dictLabel
    })
  })
  return arr
}

const stepOneData = [{
  label: '任务名称',
  dataName: 'taskName',
  component: 'input',
  type: 'text',
  span: 20,
  labelWidth: '100px',
  width: '75%'
}, {
  label: '任务描述',
  dataName: 'dsc',
  component: 'input',
  type: 'textarea',
  span: 20,
  labelWidth: '100px',
  width: '75%',
  rules: [
    {
      required: false,
      message: `请输入任务描述`,
      trigger: 'change'
    }
  ]
}, {
  label: '任务模式',
  dataName: 'start',
  component: 'select',
  span: 20,
  labelWidth: '100px',
  width: '300px',
  multiple: true,
  option: getTaskType,
  border: true,
  defaultValue: ['MYSQL'],
  inlineEl: [
    {
      multiple: true,
      dataName: 'end',
      component: 'select',
      width: '40%',
      labelWidth: '0px',
      defaultValue: ['DAMENG'],
      option: getTaskType
    }
  ]
}
  // {
  //   label: '工作模式',
  //   dataName: 'jobMode',
  //   component: 'radio',
  //   span: 20,
  //   labelWidth: '100px',
  //   width: '75%',
  //   dict: 'synchronous_jobmode',
  //   defaultValue: 'ONCE',
  //   border: true
  //   // aiModel
  // }, {
  //   label: '异常处理',
  //   dataName: 'taskPolicy',
  //   component: 'radio',
  //   span: 20,
  //   labelWidth: '100px',
  //   width: '75%',
  //   dict: 'synchronous_exceptionhandling',
  //   border: true,
  //   defaultValue: 'ERROR_CONTINUE'
  // }, {
  //   label: '任务状态',
  //   dataName: 'status',
  //   component: 'radio',
  //   span: 20,
  //   labelWidth: '100px',
  //   width: '75%',
  //   dict: 'sys_job_status',
  //   border: true,
  //   defaultValue: '0'
  // }
]

export {
  stepOneData
}
